import React from 'react';

import { SuccessRoute as Component } from '@/pagesComponents/SuccessRoute';
import { generateMetaData } from '@/shared/lib/meta';
import { GetServerSideProps } from 'next';
import Head from 'next/head';

export default function SuccessRoute({ data }: { data: { OrderId: string } }) {
  return (
    <>
      <Head>{generateMetaData({ title: 'Переадресация...' })}</Head>
      <Component OrderId={data.OrderId} />
    </>
  );
}

export const getServerSideProps: GetServerSideProps = async ({ query }) => {
  const { OrderId } = query;
  return { props: { data: { OrderId } } };
};
